<?php
declare (strict_types = 1);

namespace app\command;

use EasyTask\Task;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;

class Activity extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('activity')
             ->setDescription('拼团活动');
    }

    protected function execute(Input $input, Output $output)
    {
       // 指令输出
        $task = new Task();

        $task->setDaemon(false);

        $task->setPrefix('EasyTask');

        $task->setRunTimePath(runtime_path() .'activity');

        $task->addFunc(function () use ($output){
            $output->writeln('这是一个拼团活动');
        }, 'request', 10, 1);

        $task->start();

    }
}
